#include "processbar.h"

char* cursor = "-\\|/";

void process1()
{
    char buff[MAX];
    memset(buff, '\0', sizeof(buff));
    int n = strlen(cursor);

    int count = 0;
    buff[count] = Head;
    while (count <= 100)
    {
        printf("[%-100s][%3d%%][%c]\r", buff, count, cursor[count % n]);
        fflush(stdout);
        
        buff[count++] = Body;
        if (count < 100)
            buff[count] = Head;
        usleep(50000);
    }
    printf("\n");
}
